﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BKH.BLL;

namespace BKH.MyUserControl.UCHienThi
{
    public partial class ucThongTinNguoiNha : UserControl
    {
        int idBN;
        public ucThongTinNguoiNha(int id)
        {
            InitializeComponent();
            this.idBN = id;
            showThongTinNguoiNha();
        }
         
        void showThongTinNguoiNha()
        {
            try
            {
                NguoiNhaBUO ngNha = new NguoiNhaBUO();
                tbl_ThanNhan obj = ngNha.GetSingle(idBN);
                lblHoTen.Text = obj.FirstName + " " + obj.LastName;
                lblRelationship.Text = Relationship();
                lblTel.Text = obj.Tel;
                lblAddress.Text = obj.Address;
            }
            catch
            {
                MessageBox.Show("Ko có thông tin người nhà của bệnh nhân này");
            }
        }

        String Relationship()
        {
            RelationshipBUO r = new RelationshipBUO();
            tbl_RelationShip obj = r.GetSingle(idBN);
            return obj.RelationShipName;
        }
    }
}
